package com.fr.report.io.core;

import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.CellElement;
import com.fr.report.FloatElement;
import com.fr.report.PageSet;
import com.fr.report.PaperSetting;
import com.fr.report.ResultReport;
import com.fr.report.cellElement.CoverCellElement;
import com.fr.report.core.PackedReport;
import com.fr.report.io.ExcelExporter;
import java.util.Iterator;
import java.util.NoSuchElementException;

public class ExcelExporterReport extends PackedReport
{
  private int row;
  private int column;
  private int width;
  private int height;

  public ExcelExporterReport(ResultReport paramResultReport, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    super(paramResultReport);
    this.row = paramInt2;
    this.column = paramInt1;
    this.width = paramInt3;
    this.height = paramInt4;
  }

  public Iterator cellIterator()
  {
    return new ExcelCellIterator(this, null);
  }

  public int getColumnCount()
  {
    return this.width;
  }

  public int getColumnWidth(int paramInt)
  {
    return this.packee.getColumnWidth(paramInt + this.column);
  }

  public int getRowHeight(int paramInt)
  {
    return this.packee.getRowHeight(paramInt + this.row);
  }

  public Iterator getRow(int paramInt)
  {
    throw new UnsupportedOperationException();
  }

  public int getRowCount()
  {
    return this.height;
  }

  public Iterator floatIterator()
  {
    return new ExcelFloatIteraotr(this, null);
  }

  public void addCellElement(CellElement paramCellElement)
  {
    throw new UnsupportedOperationException();
  }

  public void addCellElement(CellElement paramCellElement, boolean paramBoolean)
  {
    throw new UnsupportedOperationException();
  }

  public CellElement getCellElement(int paramInt1, int paramInt2)
  {
    throw new UnsupportedOperationException();
  }

  public Object getCellValue(int paramInt1, int paramInt2)
  {
    throw new UnsupportedOperationException();
  }

  public Iterator getColumn(int paramInt)
  {
    throw new UnsupportedOperationException();
  }

  public void insertColumn(int paramInt)
  {
    throw new UnsupportedOperationException();
  }

  public void insertRow(int paramInt)
  {
    throw new UnsupportedOperationException();
  }

  public Iterator intersect(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    throw new UnsupportedOperationException();
  }

  public void merge(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    throw new UnsupportedOperationException();
  }

  public void removeAllCellElements()
  {
    throw new UnsupportedOperationException();
  }

  public boolean removeCellElement(CellElement paramCellElement)
  {
    throw new UnsupportedOperationException();
  }

  public CellElement removeCellElement(int paramInt1, int paramInt2)
  {
    throw new UnsupportedOperationException();
  }

  public void removeColumn(int paramInt)
  {
    throw new UnsupportedOperationException();
  }

  public void removeRow(int paramInt)
  {
    throw new UnsupportedOperationException();
  }

  public void setCellValue(int paramInt1, int paramInt2, Object paramObject)
  {
    throw new UnsupportedOperationException();
  }

  public void addFloatElement(FloatElement paramFloatElement)
  {
    throw new UnsupportedOperationException();
  }

  public void bringFloatElementForward(FloatElement paramFloatElement)
  {
    throw new UnsupportedOperationException();
  }

  public void bringFloatElementToFront(FloatElement paramFloatElement)
  {
    throw new UnsupportedOperationException();
  }

  public FloatElement getFloatElement(String paramString)
  {
    throw new UnsupportedOperationException();
  }

  public void removeAllFloatElements()
  {
    throw new UnsupportedOperationException();
  }

  public boolean removeFloatElement(FloatElement paramFloatElement)
  {
    throw new UnsupportedOperationException();
  }

  public FloatElement removeFloatElement(String paramString)
  {
    throw new UnsupportedOperationException();
  }

  public void sendFloatElementBackward(FloatElement paramFloatElement)
  {
    throw new UnsupportedOperationException();
  }

  public void sendFloatElementToBack(FloatElement paramFloatElement)
  {
    throw new UnsupportedOperationException();
  }

  public PageSet generateReportPageSet(PaperSetting paramPaperSetting)
  {
    throw new UnsupportedOperationException();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    throw new UnsupportedOperationException();
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    throw new UnsupportedOperationException();
  }

  static int access$200(ExcelExporterReport paramExcelExporterReport)
  {
    return paramExcelExporterReport.column;
  }

  static int access$300(ExcelExporterReport paramExcelExporterReport)
  {
    return paramExcelExporterReport.row;
  }

  static int access$400(ExcelExporterReport paramExcelExporterReport)
  {
    return paramExcelExporterReport.width;
  }

  static int access$500(ExcelExporterReport paramExcelExporterReport)
  {
    return paramExcelExporterReport.height;
  }

  static ResultReport access$600(ExcelExporterReport paramExcelExporterReport)
  {
    return paramExcelExporterReport.packee;
  }

  static ResultReport access$700(ExcelExporterReport paramExcelExporterReport)
  {
    return paramExcelExporterReport.packee;
  }

  private class ExcelFloatIteraotr
    implements Iterator
  {
    private FloatElement next;
    private Iterator float_it;
    private final ExcelExporterReport this$0;

    private ExcelFloatIteraotr()
    {
      this.this$0 = paramExcelExporterReport;
      this.next = null;
      this.float_it = ExcelExporterReport.access$700(paramExcelExporterReport).floatIterator();
      findNext();
    }

    public boolean hasNext()
    {
      return (this.next != null);
    }

    public Object next()
    {
      if (!(hasNext()))
        throw new NoSuchElementException("At last element");
      FloatElement localFloatElement = this.next;
      findNext();
      return localFloatElement;
    }

    private void findNext()
    {
      FloatElement localFloatElement;
      while (true)
      {
        do
        {
          if (!(this.float_it.hasNext()))
            break label98;
          localFloatElement = (FloatElement)this.float_it.next();
        }
        while ((localFloatElement.getColumn() < ExcelExporterReport.access$200(this.this$0)) || (localFloatElement.getColumn() >= ExcelExporterReport.access$200(this.this$0) + ExcelExporter.EXCELCOLS) || (localFloatElement.getRow() < ExcelExporterReport.access$300(this.this$0)));
        if (localFloatElement.getRow() < ExcelExporterReport.access$300(this.this$0) + ExcelExporter.EXCELROWS)
          break;
      }
      this.next = localFloatElement;
      return;
      label98: this.next = null;
    }

    public void remove()
    {
      throw new UnsupportedOperationException();
    }

    ExcelFloatIteraotr(, ExcelExporterReport.1 param1)
    {
      this(paramExcelExporterReport);
    }
  }

  private class ExcelCellIterator
    implements Iterator
  {
    private Iterator cell_it;
    private CellElement next;
    private final ExcelExporterReport this$0;

    private ExcelCellIterator()
    {
      this.this$0 = paramExcelExporterReport;
      this.next = null;
      this.cell_it = ExcelExporterReport.access$600(paramExcelExporterReport).intersect(ExcelExporterReport.access$200(paramExcelExporterReport), ExcelExporterReport.access$300(paramExcelExporterReport), ExcelExporterReport.access$400(paramExcelExporterReport), ExcelExporterReport.access$500(paramExcelExporterReport));
      findNext();
    }

    public boolean hasNext()
    {
      return (this.next != null);
    }

    public Object next()
    {
      if (!(hasNext()))
        throw new NoSuchElementException("At last element");
      CellElement localCellElement = this.next;
      findNext();
      return localCellElement;
    }

    private void findNext()
    {
      if (this.cell_it.hasNext())
      {
        CellElement localCellElement = (CellElement)this.cell_it.next();
        int i = localCellElement.getColumnSpan();
        int j = localCellElement.getRowSpan();
        int k = localCellElement.getColumn() - ExcelExporterReport.access$200(this.this$0);
        int l = localCellElement.getRow() - ExcelExporterReport.access$300(this.this$0);
        if (k < 0)
        {
          i = k + i;
          k = 0;
        }
        if (l < 0)
        {
          j = l + j;
          l = 0;
        }
        if (k + i > ExcelExporterReport.access$400(this.this$0))
          i = ExcelExporterReport.access$400(this.this$0) - k;
        if (l + j > ExcelExporterReport.access$500(this.this$0))
          j = ExcelExporterReport.access$500(this.this$0) - l;
        this.next = new CoverCellElement(localCellElement, k, l, i, j);
        return;
      }
      this.next = null;
    }

    public void remove()
    {
      throw new UnsupportedOperationException();
    }

    ExcelCellIterator(, ExcelExporterReport.1 param1)
    {
      this(paramExcelExporterReport);
    }
  }
}